// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "./App";
import router from "./router";
//fastclick click点击延时取消
import fastClick from "fastclick";
//H5原生交互公共方法
import interaction from "@/common/interaction/interaction.js";
//vue swiper 全能的轮播图插件
// import VueAwesomeSwiper from 'vue-awesome-swiper'
// 用于实现浏览器不支持原生功能的代码
//vue swiper 全能的轮播图插件 样式
import "swiper/dist/css/swiper.css";
import "babel-polyfill";
//淘宝rem适配方案
import "amfe-flexible/index.min.js";
//全局引用vant样式
import "vant/lib/index.css";
import "swiper/dist/css/swiper.css";
import "styles/reset.css";
import "styles/border.css";
import "styles/iconfont.css";
import "styles/main.css";
//引入文件与原生APP交互
import Bridge from "@/assets/config/bridge.js";
//引入interaction
Vue.prototype.interaction = interaction;
//引入vant
Vue.prototype.$bridge = Bridge;
// 设置为 false 以阻止 vue 在启动时生成生产提示
Vue.config.productionTip = true;
// 处理移动端click事件300毫秒延迟
fastClick.attach(document.body);
//vue-video-player与fastClick有冲突
var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
var deviceIsIOS =
    /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
fastClick.prototype.needsClick = function(target) {
    switch (target.nodeName.toLowerCase()) {
        // Don't send a synthetic click to disabled inputs (issue #62)
        case "button":
        case "select":
        case "textarea":
            if (target.disabled) {
                return true;
            }

            break;
        case "input":
            // File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
            if ((deviceIsIOS && target.type === "file") || target.disabled) {
                return true;
            }

            break;
        case "label":
        case "iframe": // iOS8 homescreen apps can prevent events bubbling into frames
        case "video":
            return true;
    }

    return (
        /\bneedsclick\b/.test(target.className) || /\bvjs/.test(target.className)
    );
};
// Vue.use(VueAwesomeSwiper)
new Vue({
    el: "#app",
    router,
    components: {
        App,
    },
    template: "<App/>",
});